package org.soft.xinyu.equipmentmanagement.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.beans.Transient;
import java.sql.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author vicente
 * @since 2021-11-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WswMachine extends Model<WswMachine> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 设备编号
     */
    private String machineId;

    /**
     * 设备名称
     */
    private String machineName;

    /**
     * 规格型号
     */
    private String machineModel;

    /**
     * 出厂编号
     */
    private String factoryNumber;

    /**
     * 生产厂家
     */
    private String manufacture;

    /**
     * 资产编号
     */
    private String assetNumber;

    /**
     * 购入价格
     */
    private String price;

    /**
     * 购入日期
     */
    private Date purchaseDate;

    /**
     * 启用时间
     */
    private Date startDate;

    /**
     * 设备管理员
     */
    private String administrator;

    /**
     * 采购人
     */
    private String purchaser;

    /**
     * 验收人
     */
    private String acceptor;

    /**
     * 责任人
     */
    private String personLiable;

    /**
     * 尺寸
     */
    private String size;

    /**
     * 功率
     */
    private String power;

    /**
     * 净重
     */
    private String weight;

    /**
     * 运行状态
     */
    private String runningState;

    /**
     * 存放位置
     */
    private String storageLocation;

    /**
     * 检定标志位（为1需要检定；为0，则不需要检定，输出文件中检定日期和检定周期画斜杠）
     */
    private String testBool;

    /**
     * 检定周期
     */
    private String testCycle;

    /**
     * 检定日期（最后一次检定覆盖）
     */
    private Date testDate;

    /**
     * 有效期至
     */
    private Date termOfValidity;

    /**
     * 送检单位
     */
    private String inspectionEnterprise;

    /**
     * 图片地址(指向一个文件夹，打开文件夹内所有图片）
     */
    private String picPath;

    /**
     * 技术文档地址(指向一个文件夹，打开文件夹内所有图片）
     */
    private String documentPath;

    /**
     * 存放检定证书的文件夹
     */
    private String certificatePath;

    /**
     * 存放铭牌的文件夹
     */
    private String nameplatePathpath;

    /**
     * 技术指标
     */
    private String technicalIndicators;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 检定点表
     */
    private transient MachineTest machineTest;

    /**
     * 附属设备表
     */
    private transient List<MachineSubmachine> machineSubmachines;

    /**
     * 是否变色
     */
    private transient boolean idRed = false;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    public String getMachineId() {
        if (machineId == null || "".equals(machineId)) {
            return "";
        }
        return machineId;
    }

    public String getMachineName() {
        if (machineName == null || "".equals(machineName)) {
            return "";
        }
        return machineName;
    }

    public String getMachineModel() {
        if (machineModel == null || "".equals(machineModel)) {
            return "";
        }
        return machineModel;
    }

    public String getFactoryNumber() {
        if (factoryNumber == null || "".equals(factoryNumber)) {
            return "";
        }
        return factoryNumber;
    }

    public String getManufacture() {
        if (manufacture == null || "".equals(manufacture)) {
            return "";
        }
        return manufacture;
    }

    public String getAssetNumber() {
        if (assetNumber == null || "".equals(assetNumber)) {
            return "";
        }
        return assetNumber;
    }

    public String getPrice() {
        if (price == null || "".equals(price)) {
            return "";
        }
        return price;
    }

    public Date getPurchaseDate() {
        return purchaseDate;
    }

    public Date getStartDate() {
        return startDate;
    }

    public String getAdministrator() {
        if (administrator == null || "".equals(administrator)) {
            return "";
        }
        return administrator;
    }

    public String getPurchaser() {
        if (purchaser == null || "".equals(purchaser)) {
            return "";
        }
        return purchaser;
    }

    public String getAcceptor() {
        if (acceptor == null || "".equals(acceptor)) {
            return "";
        }
        return acceptor;
    }

    public String getPersonLiable() {
        if (personLiable == null || "".equals(personLiable)) {
            return "";
        }
        return personLiable;
    }

    public String getSize() {
        if (size == null || "".equals(size)) {
            return "";
        }
        return size;
    }

    public String getPower() {
        if (power == null || "".equals(power)) {
            return "";
        }
        return power;
    }

    public String getWeight() {
        if (weight == null || "".equals(weight)) {
            return "";
        }
        return weight;
    }

    public String getRunningState() {
        if (runningState == null || "".equals(runningState)) {
            return "";
        }
        return runningState;
    }

    public String getStorageLocation() {
        if (storageLocation == null || "".equals(storageLocation)) {
            return "";
        }
        return storageLocation;
    }

    public String getTestBool() {
        if (testBool == null || "".equals(testBool)) {
            return "";
        }
        return testBool;
    }

    public String getTestCycle() {
        if (testCycle == null || "".equals(testCycle)) {
            return "";
        }
        return testCycle;
    }

    public Date getTestDate() {
        return testDate;
    }

    public Date getTermOfValidity() {
        return termOfValidity;
    }

    public String getInspectionEnterprise() {
        if (inspectionEnterprise == null || "".equals(inspectionEnterprise)) {
            return "";
        }
        return inspectionEnterprise;
    }

    public String getPicPath() {
        if (picPath == null || "".equals(picPath)) {
            return "";
        }
        return picPath;
    }

    public String getDocumentPath() {
        if (documentPath == null || "".equals(documentPath)) {
            return "";
        }
        return documentPath;
    }

    public String getCertificatePath() {
        if (certificatePath == null || "".equals(certificatePath)) {
            return "";
        }
        return certificatePath;
    }

    public String getNameplatePathpath() {
        if (nameplatePathpath == null || "".equals(nameplatePathpath)) {
            return "";
        }
        return nameplatePathpath;
    }

    public String getTechnicalIndicators() {
        if (technicalIndicators == null || "".equals(technicalIndicators)) {
            return "";
        }
        return technicalIndicators;
    }

    public Date getCreateTime() {
        return createTime;
    }
}
